package leader.action;

import com.opensymphony.xwork2.ActionContext;

import leader.service.Conts;
import leader.service.DirectAwardService;
import leader.service.DirectPaperService;
import leader.service.DirectPatentService;
import leader.service.DirectProjectService;
import leader.service.DirectTreatiseService;
import leader.service.StatisticService;
import teacher.bean.Paper;
import teacher.bean.Teacher;

public class StatisticsAction {

	private  int treNum;
	private  int papNum;
	private  int patNum;
	private int proNum;
	private int awaNum;
	public int getTreNum() {
		return treNum;
	}
	public void setTreNum(int treNum) {
		this.treNum = treNum;
	}
	public int getPapNum() {
		return papNum;
	}
	public void setPapNum(int papNum) {
		this.papNum = papNum;
	}
	public int getPatNum() {
		return patNum;
	}
	public void setPatNum(int patNum) {
		this.patNum = patNum;
	}
	public int getProNum() {
		return proNum;
	}
	public void setProNum(int proNum) {
		this.proNum = proNum;
	}
	public int getAwaNum() {
		return awaNum;
	}
	public void setAwaNum(int awaNum) {
		this.awaNum = awaNum;
	}
	
	public String execute()
	{
		Teacher tea=(Teacher)ActionContext.getContext().getSession().get("leader");
		StatisticService ds=new StatisticService();		
		awaNum=ds.getCountOfDirectAward(tea,Conts.state);
		
		StatisticService dts=new StatisticService();		
		treNum=dts. getCountOfDirectTreatise(tea,Conts.state);
		
		StatisticService dps=new StatisticService();		
	//	Paper paper=new Paper();
		//paper.setState(4);
//		papNum=dps.getPaperByUser(paper, null, tea2,Conts.state);
		papNum=dps.getCountOfDirectPaper(tea,Conts.state);
		
		StatisticService dpps=new StatisticService();		
		patNum=dpps. getCountOfDirectPatent(tea,Conts.state);
		
		StatisticService dppps=new StatisticService();		
		proNum=dppps.getCountOfDirectProject (tea,Conts.state);	
		
		System.out.println("方向为:"+tea.getDirection());
		
		return "succ";
		
		
	}
	
}
